import http from '../index'

// 分页获取装箱规格
export const getNorms = ({ ascended = null, current = null, size = null, sortFieldName = null, status = null, normsName = null }) => {
    return http.get("norms", { ascended, current, size, sortFieldName, status, normsName })
}

// 获取所有装箱规格
export const getNormsAll = () => {
    return http.get("norms/all")
}

// 根据sid获取装箱规格
export const getNormDetail = ({ sid }) => {
    return http.get("norms/" + sid)
}

// 新增装箱规格
export const addNorm = ({ alertStock, normsHigh, normsLength, normsName, normsWide, onwStock, packing, price, status = null, note = null }) => {
    return http.post("norms", { alertStock, normsHigh, normsLength, normsName, normsWide, note, onwStock, packing, price, status })
}

// 修改装箱规格
export const editNorm = ({ sid, alertStock, normsHigh, normsLength, normsName, normsWide, onwStock, packing, price, status = null, note = null }) => {
    return http.put("norms/" + sid, { alertStock, normsHigh, normsLength, normsName, normsWide, note, onwStock, packing, price, status })
}

// 批量删除装箱规格
export const delNorms = ({ sidList }) => {
    return http.put("norms/delete", { sidList })
}

// 根据sid启用-停用装箱规格
export const changeNormStatus = ({ sid }) => {
    return http.put("norms/" + sid + '/status')
}



